package com.example.demo;

import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.QuartzJobBean;

import java.util.Date;

public class MySecondJob extends QuartzJobBean {
    private String name;
    public void setName(String name) {
        this.name = name;
    }
    @Override
    protected void executeInternal(JobExecutionContext ctx) throws JobExecutionException {
        String username = ctx.getJobDetail().getJobDataMap().getString("name");
        System.out.println("mySecondJob:"+name+":" + new Date() + ":" + username);
    }
}
